package com.mastercard.assets.web.struts.actions;

import java.io.IOException;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.mastercard.assets.MasterCardException;
import com.mastercard.assets.util.MCUtil;
import com.mastercard.assets.util.dao.MasterCardDAO;
import com.mastercard.assets.web.struts.forms.CatalogoNuevoItemForm;
import com.mastercard.assets.web.struts.forms.LoginForm;
import com.mastercard.assets.web.util.to.UserLogin;

public class Loginmail
	extends
		Action
{
	public ActionForward execute(
							ActionMapping mapping , 
							ActionForm form ,
							HttpServletRequest request , 
							HttpServletResponse response )
		throws 
			IOException , 
			ServletException
	{
//		HttpSession session = request.getSession( ) ;
//		UserLogin user = ( UserLogin ) session.getAttribute( "UserLogin" ) ;
//		
//		// en caos de null
//		if( session == null ){    
//                        user.setNextWorkArea( "/WEB-INF/pages/WorkArea/NoUser.jsp" );
//			return mapping.findForward( "noLogin" ) ;
//                }
//		
//		// toma el userLogin
//		
//		// en caso de null
//		if( user == null ){
//                        user.setNextWorkArea( "/WEB-INF/pages/WorkArea/NoUser.jsp" );
//			return mapping.findForward( "noLogin" ) ;
//                }
		
//		user.setNextWorkArea( "/WEB-INF/pages/WorkArea/NoUser.jsp" );
		
	  	return mapping.findForward( "success" );
	}
	
}
